import java.util.Arrays;

public class work1 {
    public int[][] matrixBlockSum(int[][] mat, int k) {
        int n=mat.length;
        int m=mat[0].length;
        int [][]dp=new int[n+1][m+1];
        for (int i = 0; i <n ; i++) {
            for (int j = 0; j<m ; j++) {
                dp[i+1][j+1]=dp[i][j+1]+dp[i+1][j]-dp[i][j]+ mat[i][j];
            }
        }
        int [][]arr=new int[n][m];
        for (int i = 0; i <n ; i++) {
            for (int j = 0; j <m ; j++) {
                int x1=Math.max(1,i-k+1);
                int y1=Math.max(1,i-k+1);
                int x2=Math.min(n,i+k+1);
                int y2=Math.min(m,i+k+1);
                arr[i][j]=dp[x2][y2]-dp[x1-1][y2]-dp[x2][y1-1]+dp[x1-1][y1-1];
            }
        }
        return arr;
    }

    public static void main(String[] args) {
        int [][]arr=new int[3][2];
        System.out.println(arr.length);
        System.out.println(arr[0].length);
        for (int i = 0; i < arr.length ; i++) {
            for (int j = 0; j<arr[0].length ; j++) {
                arr[i][j]=i+1;
                System.out.println(arr[i][j]);
            }
        }
    }
}
